<script setup>
import { onLoad } from "@dcloudio/uni-app";
import { reactive } from "vue";
import { ref } from "vue";
import { validateEnterpriseAccountApi } from "@/api/reserve";
// "卡密预约",
const typeList = ref(["企业账户绑定"]);
const curType = ref(0);

onLoad((options) => {
	
});

const formData = reactive({
	number: "",
	password: "",
});

const submit = async () => {
	if (!formData.number || !formData.password) {
		uni.showToast({
			title: "请填写完整的信息",
			icon: "none",
		});
		return;
	}
	try {
		const res = await validateEnterpriseAccountApi({
			loginaccount: formData.number,
			loginpassword: formData.password,
		});
		uni.showToast({
			title: '绑定成功',
		})

		setTimeout(() => {
			uni.navigateBack(-1);
		}, 1000);
	} catch (error) {
		console.error('validateEnterpriseAccountApi error', error);
	}
};
</script>

<template>
	<view class="app-bind">
		<input class="form-input" type="tel" placeholder="请输入体检人身份证号" v-model="formData.number" />
		<input class="form-input" type="number" placeholder="密码为（身份证号后4位）" v-model="formData.password" />
		<view class="form-button" @click="submit">
			<text>去绑卡/登录</text>
		</view>
	</view>
</template>

<style src="./style.scss" scoped />
